package com.aldobucchi.mouse
{
	
	import flash.display.DisplayObject;
	
	import com.aldobucchi.core.dependency.DependencySpec;
	import com.aldobucchi.core.dependency.EventDispatcherWithDependenciesBase;


	public class MouseTrackerBase extends EventDispatcherWithDependenciesBase
	{
		
		///////////////////////////////////////////
		// target
		///////////////////////////////////////////
		
		protected var targetSpec:DependencySpec = new DependencySpec( 
			"target", 
			"targetChanged", 
			getTargetEventListenerSpecs( )   
			);
		
		[Bindable("targetChanged")]
		/**
		 * 
		 * The target over which this mouse tracker operates.
		 * Its exact meaning varies from tracker to tracker.
		 * 
		 * @return 
		 * 
		 */		
		public function get target( ):DisplayObject
		{
			return dh.getDependencyValue( targetSpec );
		}
		
		public function set target( v:DisplayObject ):void
		{
			dh.setDependencyValue( targetSpec, v );
		}
		
		
		
		///////////////////////////////////////////
		// enabled
		///////////////////////////////////////////
		
		protected var enabledSpec:DependencySpec = new DependencySpec( 
			"enabled", 
			"enabledChanged", null, false, true 
			);
		
		[Bindable("enabledChanged")]
		public function get enabled( ):Boolean
		{
			return dh.getDependencyValue( enabledSpec );
		}
		
		public function set enabled( v:Boolean ):void
		{
			dh.setDependencyValue( enabledSpec, v );
		}
		


		///////////////////////////////////////////
		// etc
		///////////////////////////////////////////
		
		
		
		protected function getTargetEventListenerSpecs( ):Array
		{
			return [ ];		
		}
		
		
		
		
		
		
	}
}